<template>
    <rx-dialog @handOk="onOk" @cancel="cancel">
        <comment ref="current" :is="currentView" :layerid="layerid" :destroy="destroy"></comment>
    </rx-dialog>
</template>

<script>
    import {RxDialog, Util} from "@lowcode/jpaas-common-lib";
    import miniQueryConfigs from './miniQueryConfig.js';
    export default {
        name: "miniQueryConfig",
        components: {RxDialog},
        props:["row","fc","layerid","destroy"],
        data(){
            return {
                currentView:''
            }
        },
        computed:{
            current(){
                return this.$refs.current;
            },
        },
        created() {
            this.currentView=miniQueryConfigs['miniQuery_'+this.fc+'Config'];
        },
        mounted(){
            this.setData();
        },
        methods:{
            onOk(e){
                var self=this;
                if(this.current.validate(function(){
                    Util.closeWindow(self, "ok");
                }));
                e.loading =false;
            },
            cancel(){
                Util.closeWindow(this,"cancel");
            },
            setData() {
                this.current.setData(this.row);
            },
            getData(){
                return this.current.getData();
            }
        }
    }
</script>

<style scoped>

</style>